﻿#pragma once

#include <string>
#include <windows.h>

#include "ui_qtmain.h"
#include "utils/FileUtil.h"
#include "utils/QtUtil.h"

#include <QtPropertyBrowser/qttreepropertybrowser.h>
// Actions
#include "actions/ActionManager.h"

// UI组件
#include "widgets/MainStatusBarManager.h"
#include "widgets/RecognitionAutoWidget.h"

#include "api/AppGlobal.h"
#include "core/ApplicationContext.h"
#include "core/ApplicationCoreSettings.h"

class qtMain : public QMainWindow
{
    Q_OBJECT

public:
    qtMain(QWidget* parent = nullptr);
    ~qtMain();

    shared_ptr<ApplicationContext> context;
    void setupUi2();

private:
    int _paneWidth = 360;

    Ui::qtMainClass ui;
    QMenu* menuFile;
    MainStatusBarManager* statusBarManager;
    QVBoxLayout* mainLayout;

    // 报表面板
    QTabWidget* tabCenter;

    // 自动识别
    QWidget* tabRecognitionAuto;
    RecognitionAutoWidget* viewRecognitionAuto;

    // 报表
    // QWidget* tabReportTableWidget;
    // ReportTableWidget* viewReportTable;
    // QWidget* tabReportWidget;
    // ReportWidget* viewReport;

private:
    void setupMenuBar();

    void setupToolBar();

    void setupStatusBar();

    void setupLayout();

    void setupPropertyPane();

    void setupCenterTab();

    void setupTabRecognitionAuto();

    void setupTabReport();

    void renderTitle();

    void closeEvent(QCloseEvent* e) override;
};
